package util;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Alex
 */
public class Map {
   public final static int WIDTH = 28;
   public final static int HEIGHT = 36;
   public final static int EMPTY = 0;
   public final static int BLOCK = 1;
   public final static int NORMAL_DOT = 2;
   public final static int MAGIC_DOT = 3;

   public static int DOT_TOTAL = 0;
   public static int map[][] = new int[HEIGHT][WIDTH];

   public static Object dots[][] = new Object[HEIGHT][WIDTH];

   /**
    * Reinicia el mapa para que se vuelva a llenar
    */
   public static void restartMap() {
       map = new int [HEIGHT][WIDTH];
       dots = new Object[HEIGHT][WIDTH];
   }

   public static Object getDot(int x, int y) {
       return dots[y][x];
   }

   public static void setDot(int x, int y, Object dot) {
       dots[y][x] = dot;
   }

   public static int getCellData(int x, int y) {
      return map[y][x];
    }

   public static double calcGridX(double x){
        return x * (448/28) + (224/28);
   }

   public static double calcGridY(double y){
        return y * (576/36) + (288/36);
   }

   public static void setCellData(int x, int y, int value) {
      map[y][x] = value;

      if ((value == MAGIC_DOT) || (value == NORMAL_DOT)) {
         DOT_TOTAL++;
       }
    } // end setData



}
